home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Begin VB.Form frmOptionsColumns
- BorderStyle = 3 'Fixed Dialog
- Caption = "Column settings"
- ClientHeight = 4755
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 5790
- ControlBox = 0 'False
- Icon = "frmOptionsColumns.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 4755
- ScaleWidth = 5790
- ShowInTaskbar = 0 'False
- StartUpPosition = 1 'CenterOwner
- Begin MSComctlLib.ListView lstColCfg
- Height = 3615
- Left = 240
- TabIndex = 0
- Top = 360
- Width = 5295
- _ExtentX = 9340
- _ExtentY = 6376
- View = 3
- LabelEdit = 1
- MultiSelect = -1 'True
- LabelWrap = -1 'True
- HideSelection = 0 'False
- Checkboxes = -1 'True
- FullRowSelect = -1 'True
- _Version = 393217
- ForeColor = -2147483640
- BackColor = -2147483643
- BorderStyle = 1
- Appearance = 1
- NumItems = 2
- BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
- Text = "Name"
- Object.Width = 2822
- EndProperty
- BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
- SubItemIndex = 1
- Text = "Description"
- Object.Width = 6350
- EndProperty
- End
- Begin VB.Frame frmColConfig
- Caption = "Select the columns to display in the main file list box:"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 3975
- Left = 120
- TabIndex = 3
- Top = 120
- Width = 5535
- End
- Begin VB.CommandButton CmdSettingsCancel
- Cancel = -1 'True
- Caption = "&Cancel"
- Height = 375
- Left = 4440
- TabIndex = 2
- Top = 4265
- Width = 1215
- End
- Begin VB.CommandButton cmdSettingsOk
- Caption = "&OK"
- Height = 375
- Left = 3120
- TabIndex = 1
- Top = 4265
- Width = 1215
- End
- Attribute VB_Name = "frmOptionsColumns"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- '=============================================================================
- ' Description: The frmSettingsColumns form gives the user the opportunity to
- ' customize which file info columns appear in the main window.
- '=============================================================================
- 'Two arrays representing the items checkboxes
- Dim bColvisible(1 To 12) As Boolean
- Dim userChoices(1 To 12) As Boolean
- 'Usual counter
- Dim counter As Integer
- '------------------------------------------------------------------------------------
- 'Checks and unchecks the boxes according to the main window's settings.
- '------------------------------------------------------------------------------------
- Private Sub CheckOrUncheck(xZip As XceedZip)
- For counter = 1 To 12 Step 1
- If bColvisible(counter) Then
- lstColCfg.ListItems.Item(counter).Checked = True
- Else
- lstColCfg.ListItems.Item(counter).Checked = False
- End If
- Next counter
- End Sub
- '------------------------------------------------------------------------------------
- 'Creates the columns on the form
- '------------------------------------------------------------------------------------
- Private Sub CreateCol(xZip As XceedZip)
- For counter = 1 To 12 Step 1
- If frmMain.lstMain.ColumnHeaders.Item(counter).Width = 0 Then
- bColvisible(counter) = False
- If frmMain.lstMain.ColumnHeaders.Item(counter).Tag = "" Then
- frmMain.lstMain.ColumnHeaders.Item(counter).Tag = "1500"
- End If
- Else
- bColvisible(counter) = True
- frmMain.lstMain.ColumnHeaders.Item(counter).Tag = Str(frmMain.lstMain.ColumnHeaders.Item(counter).Width)
- End If
- Next counter
- End Sub
- '------------------------------------------------------------------------------------
- ' Loads the items in the listbox
- '------------------------------------------------------------------------------------
- Private Sub LoadListItems(xZip As XceedZip)
- Dim setting As ListItem
- Set setting = lstColCfg.ListItems.Add(, , "Name")
- setting.SubItems(1) = "The File Name"
-
- Set setting = lstColCfg.ListItems.Add(, , "Comment")
- setting.SubItems(1) = "Comment Inserted with file"
-
- Set setting = lstColCfg.ListItems.Add(, , "Size")
- setting.SubItems(1) = "Size of file"
-
- Set setting = lstColCfg.ListItems.Add(, , "Packed")
- setting.SubItems(1) = "Size of file in the zip file"
-
- Set setting = lstColCfg.ListItems.Add(, , "Attributes")
- setting.SubItems(1) = "File Attributes"
-
- Set setting = lstColCfg.ListItems.Add(, , "CRC")
- setting.SubItems(1) = "Value used to verify integrity of file"
-
- Set setting = lstColCfg.ListItems.Add(, , "Last Modified")
- setting.SubItems(1) = "Date the file was last modified"
- Set setting = lstColCfg.ListItems.Add(, , "Last Accessed")
- setting.SubItems(1) = "Date the file was last accessed"
-
- Set setting = lstColCfg.ListItems.Add(, , "Created")
- setting.SubItems(1) = "Date the file was created"
-
- Set setting = lstColCfg.ListItems.Add(, , "Path")
- setting.SubItems(1) = "Stored Path Name"
-
- Set setting = lstColCfg.ListItems.Add(, , "Method")
- setting.SubItems(1) = "Compression Method"
- Set setting = lstColCfg.ListItems.Add(, , "Encrypted")
- setting.SubItems(1) = "Checks if file is encrypted"
- End Sub
- '------------------------------------------------------------------------------------
- ' Shows the FrmSettingsColumns form to the user
- '------------------------------------------------------------------------------------
- Public Function ShowForm(xZip As XceedZip) As Boolean
- Tag = "0"
- 'Creates the columns on the form
- Call CreateCol(xZip)
- 'Loads the main window's columns properties in the list
- Call LoadListItems(xZip)
- 'Checks or unchecks the boxes according to the column properties
- Call CheckOrUncheck(xZip)
- ' Shows the window
- Show vbModal
- ' If tag = "1" then the user clicked on ADD and the form's controls
- ' values are copied in the xZip properties
- If Tag = "1" Then
- Call UpdateColSettings(xZip)
- End If
- ShowForm = (frmOptionsColumns.Tag = "1")
- End Function
- '------------------------------------------------------------------------------------
- ' Update the columns on the main window
- '------------------------------------------------------------------------------------
- Private Sub UpdateColSettings(xZip As XceedZip)
- For counter = 1 To 12 Step 1
- If lstColCfg.ListItems.Item(counter).Checked Then
- frmMain.lstMain.ColumnHeaders.Item(counter).Width = Val(frmMain.lstMain.ColumnHeaders.Item(counter).Tag)
- Else
- frmMain.lstMain.ColumnHeaders.Item(counter).Width = 0
- End If
- Next counter
- End Sub
- '------------------------------------------------------------------------------------
- ' If OK is clicked, tag takes the "1" value
- '------------------------------------------------------------------------------------
- Private Sub cmdSettingsOk_Click()
- Tag = "1"
- Hide
- End Sub
- '------------------------------------------------------------------------------------
- ' If cancel is pressed, tag stays at "0"
- '------------------------------------------------------------------------------------
- Private Sub CmdSettingsCancel_Click()
- Hide
- End Sub
-